import router from '@system.router';
import prompt from '@system.prompt';
export default {
    data: {
        name: '',
        date: ' 请选择 ',
        gender: 'strings.male',
        education: 'strings.graduated',
        title: ""
    },
    onInit() {
        //this.title = this.$t('strings.world');
        this.title = " Administer"
    },
    getName(e) {
        this.name = e.value;
        console.info("name=" + this.name)
    },
    getDate(e) {
        this.date = e.year + '-' + (e.month + 1) + '-' + e.day;
        console.info("date=" + this.date)
    },
    getFemaleGender(e) {
        if (e.checked) {
            this.gender = 'strings.female'
            console.info("gender =" + this.gender)
        }
    },
    getMaleGender(e) {
        if (e.checked) {
            this.gender = 'strings.male'
            console.info("gender =" + this.gender)
        }
    },
    getEducation(e) {
        this.education = e.newValue;
        console.info("education=" + this.education)
    },
    onRegister() {
        if (this.name.length == 0) {
            prompt.showToast({
                message: this.$t('strings.name_null')
            })
            return;
        }
        if (this.name.length < 6) {
            prompt.showToast({
                message: this.$t('strings.name_short')
            })
            return;
        }

        router.push({
            uri: 'pages/success/success'
        })
    }
}